using System.Net;
using FinMkts.Messaging.Properties;

namespace FinMkts.Messaging.Pgm
{
    public class PgmConfigurationFromAppConfig : PgmConfiguration
    {
        public PgmConfigurationFromAppConfig()
        {
            BindInterface = Settings.Default.PgmBindInterface;
            MulticastAddress = IPAddress.Parse(Settings.Default.PgmMulticastAddress);
            MulticastPort = Settings.Default.PgmPort;
            RatePerSec = BinarySize.FromMegaBits(Settings.Default.PgmRateMbPerSec);
            WindowSize = BinarySize.FromMegaBytes(Settings.Default.PgmWindowSizeMB);
            WindowLength = Settings.Default.PgmWindowLength;
            MaxMessageSize = BinarySize.FromKiloBytes(Settings.Default.PgmBufferSizeKB);
            StatsInterval = Settings.Default.PgmStatsInterval;
            MulticastTTL = Settings.Default.PgmMulticastTTL;
            HighSpeedIntranet = Settings.Default.PgmHighSpeedIntranet;
        }
    }
}